﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core
{
    public static partial class contest
    {
        public static dynamic getCProblemCompleteInfo(int cid, char ps)
        {
            var sql = new Sql.SqlDataContext();
            var p = sql.ContestProblem.FirstOrDefault(row => row.ps == ps && row.cid == cid);
            if (p == null) return new
            {
                success = false,
                msg = "题目不存在"
            };
            return new
            {
                success = true,
                ps = p.ps,
                pid = p.pid,
                title = p.name,
                timeLimit = p.timeLimit,
                memoryLimit = p.memoryLimit,
                disabled = p.disabled,
                description = p.description,
                input = p.input,
                output = p.output,
                sampleInput = p.sampleInput,
                sampleOutput = p.sampleOutput,
                source = p.source,
                exampleLang = p.exampleLang,
                exampleCode = p.exampleCode,
                inputData = p.inputData,
                outputData = p.outputData,
                specialJudge = p.specialJudge,
                specialLang = p.specialLang,
                specialCode = p.specialCode
            };
        }
    }
}
